<!--
 * @Author: DUST
 * @Date: 2023-05-16 11:33:24
 * @LastEditors: DUST
 * @LastEditTime: 2023-05-17 11:40:25
 * @FilePath: \vite-project\src\views\admin\noteManage\index.vue
 * @Description: 
 * undefined
-->
<template>
  <admin-page-template>
    <div class="tableHeader mt10 mb10">
      <div class="flex"></div>
      <div class="flex">
        <table-top-btns :list="buttonList" />
      </div>
    </div>
    <!-- 表格 -->
    <ant-table
      v-model:rowskeys="rowskeys"
      v-model:pagination="pagination"
      :dataSource="tableData"
      :loading="tableLoading"
      :columns="columns"
    >
      <template #operation="{record}">
        <a @click="showEdit(record)">编辑</a>
        <a-divider type="vertical" />
        <a-popconfirm title="请确认是否删除？" @confirm="delNote(record)">
          <a>删除</a>
        </a-popconfirm>
      </template>
    </ant-table>
    <!-- 新增编辑弹窗 -->
    <addNoteModal
      v-if="visible"
      v-model:visible="visible"
      :type="type"
      :loading="loading"
      :data="editData"
      :tagList="tagList"
      @ok="doOk"
    />
  </admin-page-template>
</template>

<script setup lang="ts">
import addNoteModal from "../components/addNoteModal.vue";
import NoteManage from "./index";

const {
  rowskeys,
  tableLoading,
  pagination,
  tableData,
  columns,
  // 按钮合集
  buttonList,
  // 弹窗
  type,
  loading,
  visible,
  editData,
  doOk,
  showEdit,
  // 删除
  delNote,
  // 标签列表
  tagList
} = new NoteManage();

</script>